Optimal. Leaf size=32 \[ \frac{a^2 \tan ^3(c+d x)}{3 d}+\frac{a^2 \tan (c+d x)}{d} \]
[Out]
________________________________________________________________________________________
Rubi [A] time = 0.0250517, antiderivative size = 32, normalized size of antiderivative = 1., number of steps used = 4, number of rules used = 3, integrand size = 14, \(\frac{\text{number of rules}}{\text{integrand size}}\) = 0.214, Rules used = {3657, 12, 3767} \[ \frac{a^2 \tan ^3(c+d x)}{3 d}+\frac{a^2 \tan (c+d x)}{d} \]
Antiderivative was successfully verified.
[In]
[Out]
Rule 3657
Rule 12
Rule 3767
Rubi steps
\begin{align*} \int \left (a+a \tan ^2(c+d x)\right )^2 \, dx &=\int a^2 \sec ^4(c+d x) \, dx\\ &=a^2 \int \sec ^4(c+d x) \, dx\\ &=-\frac{a^2 \operatorname{Subst}\left (\int \left (1+x^2\right ) \, dx,x,-\tan (c+d x)\right )}{d}\\ &=\frac{a^2 \tan (c+d x)}{d}+\frac{a^2 \tan ^3(c+d x)}{3 d}\\ \end{align*}
Mathematica [A] time = 0.0394271, size = 26, normalized size = 0.81 \[ \frac{a^2 \left (\frac{1}{3} \tan ^3(c+d x)+\tan (c+d x)\right )}{d} \]
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
Maple [A] time = 0.003, size = 25, normalized size = 0.8 \begin{align*}{\frac{{a}^{2}}{d} \left ({\frac{ \left ( \tan \left ( dx+c \right ) \right ) ^{3}}{3}}+\tan \left ( dx+c \right ) \right ) } \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Maxima [A] time = 1.49551, size = 80, normalized size = 2.5 \begin{align*} a^{2} x + \frac{{\left (\tan \left (d x + c\right )^{3} + 3 \, d x + 3 \, c - 3 \, \tan \left (d x + c\right )\right )} a^{2}}{3 \, d} - \frac{2 \,{\left (d x + c - \tan \left (d x + c\right )\right )} a^{2}}{d} \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Fricas [A] time = 0.998854, size = 66, normalized size = 2.06 \begin{align*} \frac{a^{2} \tan \left (d x + c\right )^{3} + 3 \, a^{2} \tan \left (d x + c\right )}{3 \, d} \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Sympy [A] time = 0.32683, size = 37, normalized size = 1.16 \begin{align*} \begin{cases} \frac{a^{2} \tan ^{3}{\left (c + d x \right )}}{3 d} + \frac{a^{2} \tan{\left (c + d x \right )}}{d} & \text{for}\: d \neq 0 \\x \left (a \tan ^{2}{\left (c \right )} + a\right )^{2} & \text{otherwise} \end{cases} \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Giac [B] time = 1.34174, size = 180, normalized size = 5.62 \begin{align*} -\frac{3 \, a^{2} \tan \left (d x\right )^{3} \tan \left (c\right )^{2} + 3 \, a^{2} \tan \left (d x\right )^{2} \tan \left (c\right )^{3} + a^{2} \tan \left (d x\right )^{3} - 3 \, a^{2} \tan \left (d x\right )^{2} \tan \left (c\right ) - 3 \, a^{2} \tan \left (d x\right ) \tan \left (c\right )^{2} + a^{2} \tan \left (c\right )^{3} + 3 \, a^{2} \tan \left (d x\right ) + 3 \, a^{2} \tan \left (c\right )}{3 \,{\left (d \tan \left (d x\right )^{3} \tan \left (c\right )^{3} - 3 \, d \tan \left (d x\right )^{2} \tan \left (c\right )^{2} + 3 \, d \tan \left (d x\right ) \tan \left (c\right ) - d\right )}} \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]